package com.yxx.business.entity;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxx.common.annotation.Excel;
import com.yxx.common.core.domain.BaseColumnEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.experimental.Accessors;
import lombok.*;

import javax.validation.constraints.NotNull;

/**
 * 工程信息Do对象 tb_engineering
 *
 * @author yxx
 * @date 2025-08-03
 */
@Schema(description = "工程信息Do实体")
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Builder
@Data
@TableName(value = "tb_engineering", autoResultMap = true)
public class TbEngineeringDo extends BaseColumnEntity {

    private static final long serialVersionUID = 1L;

    @Schema(description = "工程ID")
    @TableId(value = "engineering_id", type = IdType.AUTO)
    private Long engineeringId;

    @Schema(description = "工程名称")
    @TableField("engineering_name")
    @Excel(name = "工程名称")
    private String engineeringName;

    @Schema(description = "工程编号")
    @TableField("engineering_code")
    @Excel(name = "工程编号")
    private String engineeringCode;

    @Schema(description = "建设地点")
    @TableField("construction_site")
    @Excel(name = "建设地点")
    private String constructionSite;

    @Schema(description = "使用年限")
    @TableField("service_life")
    @Excel(name = "使用年限")
    private Long serviceLife;

    @Schema(description = "工程里程")
    @TableField("mileage")
    @Excel(name = "工程里程")
    private BigDecimal mileage;

    @Schema(description = "建设单位")
    @TableField("construction_unit")
    @Excel(name = "建设单位")
    private String constructionUnit;

    @Schema(description = "设计单位")
    @TableField("design_unit")
    @Excel(name = "设计单位")
    private String designUnit;

    @Schema(description = "施工单位")
    @TableField("construction_corp")
    @Excel(name = "施工单位")
    private String constructionCorp;

    @Schema(description = "施工开始时间")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "施工开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @Schema(description = "施工结束时间")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "施工结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @Schema(description = "运维单位")
    @TableField("operation_corp")
    @Excel(name = "运维单位")
    private String operationCorp;

    @Schema(description = "碳排放编制人员")
    @TableField("carbon_compiler")
    @Excel(name = "碳排放编制人员")
    private String carbonCompiler;

    @Schema(description = "碳排放因子（kgCO2e/kWh或kgCO2e/kg）")
    @TableField("carbon_factor")
    @Excel(name = "碳排放因子", readConverterExp = "k=gCO2e/kWh或kgCO2e/kg")
    private BigDecimal carbonFactor;

    @Schema(description = "创建者id")
    @TableField("create_by_id")
    private Long createById;

    @Schema(description = "更新者id")
    @TableField("create_by_id")
    private Long updateById;
}
